package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.SonglistDAO;
import cn.nebula.music.domain.Songlist;

@Component
public class StringToSonglistConverter implements Converter<String,Songlist>{

	@Autowired
	private SonglistDAO songlistDAO;
	
	@Override
	public Songlist convert(String source) {
		return songlistDAO.findSonglistById(Integer.valueOf(Integer.valueOf(source)));
	}

	
	
}
